<!DOCTYPE html>
<html>
<head>
  <title>旅游网站</title>
  <style>
    /* 头部样式 */
    .header {
      background-color: #333;
      color: #fff;
      padding: 20px;
      text-align: center;
    }

    /* 导航栏样式 */
    .navbar {
      background-color: #333;
      overflow: hidden;
    }

    .navbar a {
      float: left;
      color: #f2f2f2;
      text-align: center;
      padding: 14px 16px;
      text-decoration: none;
      font-size: 17px;
    }

    .navbar a:hover {
      background-color: #ddd;
      color: black;
    }

    /* 侧边栏样式 */
    .sidebar {
      width: 200px;
      height: 100%;
      background-color: #f1f1f1;
      position: fixed;
      overflow: auto;
    }

    .sidebar a {
      display: block;
      color: black;
      padding: 16px;
      text-decoration: none;
    }

    .sidebar a:hover {
      background-color: #ddd;
    }

    @media screen and (max-width: 576px) {
      .sidebar {
        display: none;
      }
    }

    /* 文章样式 */
    .content {
      display: grid;
      grid-template-columns: 1fr 3fr;
      grid-gap: 20px;
      margin-left: 200px;
      padding: 20px;
    }

    /* 页脚样式 */
    .footer {
      background-color: #333;
      color: #fff;
      padding: 20px;
      text-align: center;
    }

    /* 轮播图样式 */
    .slideshow-container {
      max-width: 100%;
      position: relative;
      margin: auto;
    }

    .slideshow-container img {
      width: 100%;
      height: auto;
    }

    .slideshow-container .slide {
      display: none;
      position: absolute;
      top: 0;
      left: 0;
    }

    .slideshow-container .slide.active {
      display: block;
    }
  </style>
</head>
<body>
  <div class="header">
    <h1>旅游网站</h1>
  </div>

  <div class="navbar">
    <a href="#">首页</a>
    <a href="#">目的地</a>
    <a href="#">旅游路线</a>
    <a href="#">联系我们</a>
  </div>

  <div class="sidebar">
    <a href="#">侧边栏项目1</a>
    <a href="#">侧边栏项目2</a>
    <a href="#">侧边栏项目3</a>
    <a href="#">侧边栏项目4</a>
  </div>

  <div class="content">
    <div class="slideshow-container">
      <div class="slide active">
        <img src="img/smar2.webp" alt="图片1">
      </div>
      <div class="slide">
        <img src="img/smar1.webp" alt="图片2">
      </div>
      <div class="slide">
        <img src="img/smar3.webp" alt="图片3">
      </div>
    </div>

    <div>
      <h2>文章标题</h2>
      <p>这是一篇关于旅游的文章内容。</p>
    </div>
  </div>

  <div class="footer">
    <p>版权所有 &copy; 2022 旅游网站</p>
  </div>

  <script>
    // JavaScript代码可以在这里添加

    // 轮播图逻辑
    var slides = document.querySelectorAll('.slide');
    var currentSlide = 0;

    function showSlide(n) {
      for (var i = 0; i < slides.length; i++) {
        slides[i].classList.remove('active');
      }
      slides[n].classList.add('active');
    }

    function nextSlide() {
      currentSlide++;
      if (currentSlide >= slides.length) {
        currentSlide = 0;
      }
      showSlide(currentSlide);
    }

    setInterval(nextSlide, 3000);
  </script>
</body>
</html>
